﻿using IdentityServer3.Core;
using IdentityServer3.Core.Models;
using System.Collections.Generic;

namespace IdentityServer
{
    static class Clients
    {
        public static List<Client> Get()
        {
            return new List<Client>
            {
                new Client
                {
                    ClientName = "Console Client Application",
                    ClientId = "ConsoleApplication",
                    Enabled = true,
                    Flow = Flows.ResourceOwner,
                    ClientSecrets = new List<Secret>
                    {
                        new Secret("F621F470-9731-4A25-80EF-67A6F7C5F4B8".Sha256())
                    },
                    AllowedScopes = new List<string>
                    {
                        "WebApi1"
                    }
                },
                new Client
                {
                    ClientName = "WebApi1 Application",
                    ClientId = "WebApi1",
                    Enabled = true,
                    Flow = Flows.Custom,
                    ClientSecrets = new List<Secret>
                    {
                        new Secret("4B79A70F-3919-435C-B46C-571068F7AF37".Sha256())
                    },
                    AllowedCustomGrantTypes = new List<string>
                    {
                        "act-as"
                    },
                    AllowedScopes = new List<string>
                    {
                        "WebApi2"
                    }
                },
                new Client 
                {
                    ClientName = "WPF Client",
                    ClientId = "hybridclient",
                    ClientSecrets = new List<Secret>
                    { 
                        new Secret("secret".Sha256())
                    },
                    Flow = Flows.Hybrid,
                    AllowedScopes = new List<string>
                    {
                        Constants.StandardScopes.OpenId,
                        Constants.StandardScopes.Profile,
                        Constants.StandardScopes.Email,
                        Constants.StandardScopes.Roles,
                        Constants.StandardScopes.OfflineAccess,

                        "WebApi1"
                    },
                    
                    ClientUri = "https://identityserver.io",
                    LogoUri = "",
                    RequireConsent = true,
                    AllowRememberConsent = true,                    
                    RedirectUris = new List<string>
                    {
                        "oob://localhost/wpfclient"
                    }
                }
            };
        }
    }
}